<template>
  <div class="newList">
    <div class="newList-title" v-if="title">
      <span class="newList-title-p1 reset">
        <van-icon class="icon" :class="{line:!title.icon}" :name="title.icon" />
        {{title.title}}
      </span>
      <span class="newList-title-p2" @click="moreNews(title)">
        查看更多
        <van-icon name="arrow" />
      </span>
    </div>
    <ul class="news-box">
       <li class="news-item" v-for="(i,index) in list" :key="index">
        <newsItem :i="i"></newsItem>
      </li>
    </ul>
  </div>
</template>

<script type="text/ecmascript-6">
import newsItem from "./newstLi";
export default {
  props: ["title", "list"],
  components: {
    newsItem
  },
  methods: {
    moreNews(title) {
      let query = {};
      query.channel = title.name;
      this.$router.push({ path: "consultpart", query: query });
    },
  }
};
</script>

<style scoped lang="less">
@import url('./news.less');
</style>
